#怎样验证一个字符串是“YYYY–mm–dd”的格式呢？
import re
def date_is_right(date):
    return re.match("\d{4}-\d{2}-\d{2}", date)

date1 = "2025-08-12"
date2 = "202-08-12"
date3 = "2025/08-12"
date4 = "20250812"

print(date1, date_is_right(date1))
print(date1, date_is_right(date2))
print(date3, date_is_right(date1))
print(date4, date_is_right(date4))